﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace UFIDA.U9.CUST.AITMOListBListUIModel
{
	[Serializable]
	public partial class AITMOListBListUIModelModel : UIModel
	{
		#region Constructor
		public AITMOListBListUIModelModel() : base("AITMOListBListUIModel")
		{
			InitClass();
			this.SetResourceInfo("ff0a5e3c-028c-4e20-86d7-9858b0b0e859");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private AITMOListBListUIModelModel(bool isInit) : base("AITMOListBListUIModel")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new AITMOListBListUIModelModel(false);
		}
		#endregion
		#region member
		#region views
		private MOView viewMO;			
		#endregion
		
		#region links
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public MOView MO
		{
			get { return (MOView)this["MO"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewMO = new MOView(this);
			this.viewMO.SetResourceInfo("ee1a2d7f-b551-4325-bc11-dc6f298cdb3c");
			this.Views.Add(this.viewMO);			

			
		}

		public override string AssemblyName
		{
			get { return "UFIDA.U9.CUST.AITBarCodeUI"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class MOView : UIView
	{
		#region Constructor
		public MOView(IUIModel model) : base(model,"MO","UFIDA.U9.MO.MO.MO", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private MOView():base(null,"MO","UFIDA.U9.MO.MO.MO", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new MOView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}


		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "ID", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","08de5f5b-b1e8-4121-8c6f-aff387de7760");


		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new MORecord(builder);
		}
		#endregion

		#region new method
		public new MORecord FocusedRecord
		{
			get { return (MORecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new MORecord AddNewUIRecord()
		{	
			return (MORecord)base.AddNewUIRecord();
		}
		public new MORecord NewUIRecord()
		{	
			return (MORecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class MORecord : UIRecord
	{
		#region Constructor
		public MORecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private MOView uiviewMO
		{
			get { return (MOView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new MORecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewMO.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewMO.FieldID);
			}
			set{
				this[this.uiviewMO.FieldID] = value;
			}
		}
		#endregion
	}
	



}